package ch3;

public class Triangle {
	// 设计三角形类，包括三条边，提供计算三角形的面积(利用海伦公式)和周长的方法
	double a, b, c;

	public Triangle() {
	}

	public Triangle(double a, double b, double c) {
		this.a = a;
		this.b = b;
		this.c = c;
	}

	public void show() {
		System.out.println("这个三角形三边分别是 " + a + "," + b + "," + c);
		// double c = 13.0;
		// System.out.println(this.c);
	}

	public double zhouchang() {
		double p = a + b + c;
		return p;
	}

	public double count() {
		// double m2 = p / 2;
		double m = zhouchang() / 2;
		double s = Math.sqrt(m * (m - a) * (m - b) * (m - c));
		return s;
	}
}
